﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;

namespace NhJump.Persistence.Context.WcfBinding
{
    public class WcfUnitOfWorkBinder : IUnitOfWorkBinder
    {
        public UnitOfWork GetCurrent()
        {
            var extension = OperationContext.Current.InstanceContext.Extensions.Find<WcfUnitOfWorkExtension>();

            if(extension==null)
                return null;

            return extension.UnitOfWork;
        }

        public void Bind(UnitOfWork unitOfWork)
        {
        }

        public void UnBind()
        {
        }
    }
}